$(function(){
	//提交事件
	$('#submitBtn').click(function(){
		var $n = $('#sysDepartmentName');
		
		if($n.val() == ''){
			jAlert('名称必填');
			return;
		};
		
		function collectData(){
			var a = new Array();
			a.push('sysDepartment.name=' + $n.val());
			return a.join('&');
		}

		$.ajax({
			type:'POST',
			url: 'sysDepartmentAction!addDepartment.ac',
			data: collectData(),
			dataType:'json',
			beforeSend:function(){
				jLoading("正在操作，请稍后...");
			},
			success:function(rs){
				if(rs.flag){
					jAlert('操作成功');
				}else{
					jAlert('操作失败:' + rs.msg);
				}
			}
		});
	});
});